package com.itheima.methodreference;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Student {

    //姓名、年龄、性别、身高
    private String name;
    private int age;
    private String sex;
    private double height;

    //静态方法
    public static int compareByAge(Student s1, Student s2) {
        return s1.getAge() - s2.getAge();
    }

    //实例方法
    public int compareByHeight(Student s1, Student s2) {
        return Double.compare(s1.getHeight(), s2.getHeight());
    }
}
